package designPattern.struction.decoratorpattern.hamburger;


/**
 * 辣椒 -- 装饰类
 * @author 张琪
 * @date 2023/2/6 11:36
 */
public class Chilli extends Condiment{

    Hamburger hamburger;

    public Chilli(Hamburger hamburger) {
        this.hamburger = hamburger;
    }

    @Override
    public String getName() {
        return hamburger.getName() + "加辣椒";
    }

    @Override
    public double getPrice() {
        // 辣椒免费
        return hamburger.getPrice();
    }
}
